package com.ryskoo.cms.advert.service;

import com.ryskoo.cms.advert.domain.AdvertPO;
import com.ryskoo.cms.advert.repository.IAdvertRepository;
import com.ryskoo.framework.core.service.BasicServiceImpl;
import com.ryskoo.framework.core.utils.DateFormatHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author renyuting
 * @data 2018-05-03
 */
@Service
public class AdvertServiceImpl extends BasicServiceImpl<AdvertPO> implements IAdvertService{
    @Autowired
    private IAdvertRepository advertRepository;

    @PostConstruct
    public void init(){
        this.setDao(advertRepository);
    }

    @Override
    public void create(AdvertPO advertPO) {
        advertPO.setCreateTime(DateFormatHelper.getNowTimeStr());
        super.create(advertPO);
    }
}
